import {createRouter, createWebHistory} from 'vue-router';
const modules = import.meta.glob("../view/**/*.vue");

/**
 * 路由
 *
 * @type {{}}
 */
const router = createRouter({    history: createWebHistory(), routes:[]});

// some static page
router.addRoute({
    path: '/',
    name: 'home',
    label: '系统主页',
    component: () => import('@/view/index.vue')
});

router.addRoute({
    path: '/test',
    name: 'test',
    label: '测试页',
    component: () => import('@/view/test.vue')
});

router.addRoute({
    path: '/screen',
    name: 'screen',
    label: '首页大屏',
    component: () => import('@/view/screen.vue')
});

router.addRoute({
    path: '/login',
    name: "login",
    label: '登录界面',
    component: () => import('@/view/login.vue'),
});

router.addRoute({
    path: '/register',
    name: "register",
    label: '注册界面',
    component: () => import('@/view/register.vue'),
});

router.addRoute({
    path: '/lock',
    name: "lock",
    label: '锁屏',
    component: () => import('@/view/lock.vue'),
});


// 含二级路由
router.addRoute(    {
    path: '/sample',
    name: 'sample',
    label: '基础 UI',
    component: () => import('@/view/example/index.vue')
});

// 含二级路由
router.addRoute(    {
    path: '/gis',
    name: 'gis',
    label: 'GIS 开发',
    component: () => import('@/view/gis/index.vue')
});

// 含二级路由
router.addRoute(    {
    path: '/core',
    name: 'core',
    label: '核心业务',
    component: () => import('@/view/core/index.vue')
});

// E.G.: 动态路由
// router.addRoute({
//     name: menu.name,
//     label: menu.title,
//     path: menu.path,
//     component: modules[url]
// });
export default router;